/**
 * @FastJsonBusiMixedEncoder.java  COPYRIGHT xiaojian
 * 
 * Created on 2017年7月21日 上午9:29:46
 */
package xj.toolkit.access.busi.codec;

import com.alibaba.fastjson.JSON;

import io.netty.channel.ChannelHandler;
import xj.toolkit.util.MutableIdentifyable;
import xj.toolkit.access.msg.AccessAckMessage;

/**
 * @author <a href="mailto:cxj2000@gmail.com">xiaojian.cao</a>
 *
 */
@ChannelHandler.Sharable
public class FastJsonBusiMixedEncoder extends JsonBusiMixedEncoder {

	@Override
	protected byte[] build(MutableIdentifyable msg) {
		
		if (msg instanceof AccessAckMessage) {
			return new byte[0];
		}
		
		return JSON.toJSONBytes(msg);
	}

}
